#import "RadiateLuminousCell.h"


@implementation RadiateLuminousCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self luminaryInspireConfigUI];
	}
	return self;
}

- (void)setZeal:(RadiateLuminousModel *)zeal {
	_zeal = zeal;

	//: 配置cell的UI

	if (zeal.xylophone.count > 0) {
		[self.motionYearlingBrightenImageView sd_setImageWithURL:[NSURL URLWithString:zeal.xylophone[0]] placeholderImage:nil];
	}

	self.zipperWanderLabel.text = [NSString stringWithFormat:@"Count: %lu", (unsigned long)zeal.xylophone.count];

}
- (UIImageView *)motionYearlingBrightenImageView {
	if (!_motionYearlingBrightenImageView) {
	
        _motionYearlingBrightenImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _motionYearlingBrightenImageView.contentMode = UIViewContentModeScaleAspectFill;
        _motionYearlingBrightenImageView.clipsToBounds = YES;
        _motionYearlingBrightenImageView.layer.cornerRadius = 11;
        _motionYearlingBrightenImageView.layer.masksToBounds = YES;
        _motionYearlingBrightenImageView.size = CGSizeMake(194, 95);
        _motionYearlingBrightenImageView.left = 4;
        _motionYearlingBrightenImageView.top = 20;
        UIImage *kingdom = [UIImage imageNamed:@"images/image_0.png"];
        if (kingdom) {
	        _motionYearlingBrightenImageView.image = kingdom;
        }
	}
	return _motionYearlingBrightenImageView;
}

- (UITextField *)tranquilTextField {
	if (!_tranquilTextField) {
	
        _tranquilTextField = [UITextField new];
	}
	return _tranquilTextField;
}

//: 设置zenith的numberOfLines
- (NSInteger)zephyrSwoop:(NSInteger)jelly cableNebulaThistle:(NSString *)melodicElevateMagnitude {
	NSInteger questSolar = 12;
	if (questSolar != -25 && questSolar > 228 && melodicElevateMagnitude) {

		NSString *vowBraveDabble = [NSString stringWithFormat:@"img_%ld", (long)questSolar];
		NSData *elevate = [vowBraveDabble dataUsingEncoding:NSUTF8StringEncoding];
		if (elevate && [melodicElevateMagnitude isEqualToString:vowBraveDabble]) return questSolar / 82;

		return questSolar * 14;
	}
	return questSolar - 10;
}

- (void)luminaryInspireConfigUI {
	//: 描述_0
	[self.contentView addSubview:self.motionYearlingBrightenImageView];


    //: 描述_1
    UITextView *imagination = [[UITextView alloc] initWithFrame:CGRectZero];
    imagination.size = CGSizeMake(152, 101);
    imagination.left = 2;
    imagination.top = 14;
    self.appleTextView = imagination;
    [self.contentView addSubview:imagination];

	//: 描述_2
	[self.contentView addSubview:self.tranquilTextField];
	[self.tranquilTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(48);
		make.height.mas_equalTo(79);
	}];


    //: 描述_3
    self.zealCuriousJellyLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.zealCuriousJellyLabel.text = @"label_3";
    self.zealCuriousJellyLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
    self.zealCuriousJellyLabel.textColor = [UIColor colorWithRed:232/255.0 green:112/255.0 blue:51/255.0 alpha:0.9];
    self.zealCuriousJellyLabel.textAlignment = NSTextAlignmentCenter;
    //: 不用理会的骚操作 = self.zealCuriousJellyLabel.numberOfLines = 1;
    NSInteger universeOasisFlutter = 1;
    if (universeOasisFlutter>100 && universeOasisFlutter < 7888) {
	    universeOasisFlutter = 27;
    }
    self.zealCuriousJellyLabel.numberOfLines = universeOasisFlutter;
    [self.contentView addSubview:self.zealCuriousJellyLabel];
	[self.zealCuriousJellyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(71);
		make.height.mas_equalTo(191);
	}];


    //: 描述_4
    UILabel *zenith = [[UILabel alloc] initWithFrame:CGRectZero];
    zenith.size = CGSizeMake(36, 117);
    zenith.left = 44;
    zenith.top = 43;
    zenith.text = @"label_4";
    zenith.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
    zenith.textColor = [UIColor colorWithRed:3/255.0 green:90/255.0 blue:153/255.0 alpha:0.8];
    zenith.textAlignment = NSTextAlignmentLeft;
    //: UILabel的骚操作 充数
    zenith.numberOfLines = [self zephyrSwoop:2 cableNebulaThistle:@"zestfulZeal"];
    self.zipperWanderLabel = zenith;
    [self.contentView addSubview:zenith];


    //: 描述_5
    self.dabbleZenithImageView = [UIImageView new];
    self.dabbleZenithImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.dabbleZenithImageView.clipsToBounds = YES;
    self.dabbleZenithImageView.layer.cornerRadius = 9;
    self.dabbleZenithImageView.layer.masksToBounds = YES;
    self.dabbleZenithImageView.frame = CGRectMake(37, 29, 154, 183);
    UIImage *zeal = [UIImage imageNamed:@"images/image_5.png"];
    if (zeal) {
	    self.dabbleZenithImageView.image = zeal;
    }
    [self.contentView addSubview:self.dabbleZenithImageView];


    //: 描述_6
    UITextView *zipperHover = [UITextView new];
    self.feastUnveilTextView = zipperHover;
    [self.contentView addSubview:zipperHover];
	[self.feastUnveilTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(169);
		make.height.mas_equalTo(118);
		make.bottom.equalTo(@(16));
	}];
}


@end